package com.eduask.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eduask.beans.Manager;
import com.eduask.dao.ManagerDAO;
import com.eduask.util.HibernateUtil;

@Repository
public class ManagerDAOImpl extends HibernateUtil implements ManagerDAO{

	@Override
	public Manager findManagerById(Integer id) {
		return getSession().get(Manager.class, id);
	}

	@Override
	public List<Manager> findAllManagers() {
		String hql = "from Manager manager order by manager.id asc";
		return getSession().createQuery(hql).list();
	}

}
